package cn.net.wangyixinwen.mvvm.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import cn.net.wangyixinwen.R;
import cn.net.wangyixinwen.bean.NewsBean;
import cn.net.wangyixinwen.bean.VideoBean;

public class VideoAdapter extends BaseQuickAdapter<VideoBean, BaseViewHolder> {
    public VideoAdapter() {
        super(R.layout.item_video);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, VideoBean item) {
        baseViewHolder.setText(R.id.tv_title, item.getTitle());
        baseViewHolder.setText(R.id.tv_time, item.getPtime());
        baseViewHolder.setText(R.id.tv_ltitle, item.getTopicDesc());
        baseViewHolder.setText(R.id.tv_info, "播放量:" + item.getPlayCount() + "  " + "点赞:" + item.getVoteCount() + "  " + "回复:" + item.getReplyCount() + "  ");
        Glide.with(baseViewHolder.itemView)
                .load(item.getCover())
                .into((ImageView) baseViewHolder.getView(R.id.iv_image));
    }
}
